package com.example.utils;

/**
 * @Author xiao
 * @Date 2025/5/6 下午 3:44
 * @ClassName: UserContext
 * @Desc:
 */
public class UserContext {
    private final static ThreadLocal<Long> tl = new ThreadLocal<>();

    public static void setUserId(long userId) {
        tl.set(userId);
    }
    public static long getUserId(){
        return tl.get();
    }
    public static void removeUserId(){
        tl.remove();
    }

}
